package com.qf.main.login.controller;

import com.qf.common.base.result.ResponseResult;
import com.qf.main.login.common.vo.SysPermissionVo;
import com.qf.main.login.entity.SysPermission;
import com.qf.main.login.service.PermissionService;
import com.qf.main.login.service.impl.PermissionServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author chengqiang
 * @Create 2024-01-19-17:47
 * @Description:
 */

@RestController
@RequestMapping("/permission")
@Api(tags = "权限")
@CrossOrigin
public class SysPermissionController {

    @Resource(name="permissionService")
    private PermissionService permissionService;

    @GetMapping("/list")
    @ResponseBody
    @ApiOperation("查询全部权限")
    @ApiResponses({@ApiResponse(code = 200, message = "成功", response = String.class), @ApiResponse(code = 400, message = "系统错误")})
    public ResponseResult<List<SysPermissionVo>> listPermission(){
        List<SysPermissionVo> sysPermissionVoList = permissionService.queryPermissionList();
        return ResponseResult.success(sysPermissionVoList);
    }




}
